import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String[] array = new String[100];
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++){
            array[i]=scanner.next();
        }
        char x = 0;
        Solution solution = new Solution();
        solution.findWordsContaining(array,x);
    }
}

class Solution {
    public List<Integer> findWordsContaining(String[] words, char x) {
        List<Integer> res = new ArrayList<>();
        int n = words.length;
        for (int i = 0; i < n; i++) {
            if (words[i].indexOf(x) != -1) {
                res.add(i);
            }
        }
        return res;
    }
}
